/**
 * 
 */
package commons.internal;

import java.util.Random;

import server.StorageUnitID;
import server.internal.DefaultStorageUnitID;

import commons.id.IDGenerator;

/**
 * @author armstrong
 * 
 */
public class StorageUnitIDGenerator implements IDGenerator<StorageUnitID> {

	private final Random	generator;

	public StorageUnitIDGenerator() {

		generator = new Random();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see commons.IDGenerator#generateID()
	 */
	@Override
	public StorageUnitID generateID() {

		final Long numberID = generator.nextLong();
		return DefaultStorageUnitID.createId(numberID.toString());
	}
}
